version: '3.9'
#networks:
#  bridge:
#    driver: bridge
#    ipam:
#      config:
#        - subnet: 172.27.1.0/24
#          gateway: 172.27.1.1
services:
  web:
    image: prmo
    ports:
      - 8080:8080
    #    networks:
    #      bridge:
    #        ipv4_address: 172.27.1.100
    depends_on:
      db:
        condition: service_healthy
    #        restart: true
    volumes:
      - ./prmo:/opt
  db:
    image: postgres
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=prmo_db
    ports:
      - 5432:5432
    #    networks:
    #      bridge:
    #        ipv4_address: 172.27.1.101
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER}" ]
      interval: 10s
      timeout: 5s
      retries: 5